package com.itqf;

import com.itqf.service.GoodsService;
import com.itqf.service.OrderService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @Description:
 * @Company: 千锋互联
 * @Author: 李丽婷
 * @Date: 2020/11/10
 * @Time: 下午5:02
 */
public class TestSpringAspectAop {
    public  static  void  main(String[]args){
        ApplicationContext ac = new ClassPathXmlApplicationContext("applicationContext-aspectj-aop.xml");
        //代理对象
        OrderService orderService = ac.getBean(OrderService.class);//com.itqf.service.impl.OrderServiceImpl

        orderService.addOrder();
        orderService.updateOrder();

        System.out.println("--------------------");

        GoodsService goodsService = ac.getBean(GoodsService.class);
        goodsService.addGoods("张三");
        System.out.println( goodsService.updateGoods());



    }
}
